package dbc;

import java.sql.*;

public abstract class DBI {
    //开始数据库
    public abstract Connection openConn()throws SQLException;
    //关闭数据库
    public abstract void closeConn()throws SQLException;
    //释放资源
    public void closeAll(Statement st, PreparedStatement ps, ResultSet rs)throws SQLException{
        if (st!=null){
            st.close();
        }
        if (ps!=null){
            ps.close();
        }
        if (rs!=null){
            rs.close();
        }
    }
}
